home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / telecomm / fido / plthed11.lha / PlutHeadit.LST < prev    next >
Encoding:
File List  |  1994-01-31  |  24.9 KB  |  1,293 lines

  1. '
  2. ' PlutHeadit - Message Header Editor
  3. '
  4. ' (c) Copyright 1993
  5. '
  6. ' By Peter Deane  3:622/401.0@FidoNet
  7. '
  8. versname$="PlutHeadit"
  9. versnum$="1.1"
  10. versdate$="31-Jan-1994"
  11. '
  12. '
  13. '
  14. DIM m68%(15)
  15. DIM ansi$(10)
  16. esc$=CHR$(27)
  17. fourdmsg!=TRUE
  18. @setansi
  19. @open_screen
  20. '
  21. aa$=UPPER$(_dosCmd$)
  22. aa$=TRIM$(aa$)
  23. '
  24. aa%=INSTR(aa$," ")
  25. IF aa%=0
  26.   arg1$=aa$
  27.   arg2$=""
  28. ELSE
  29.   arg1$=LEFT$(aa$,aa%-1)
  30.   arg1$=TRIM$(arg1$)
  31.   arg2$=MID$(aa$,aa%,255)
  32.   arg2$=TRIM$(arg2$)
  33. ENDIF
  34. '
  35. '
  36. IF LEN(arg1$)=2
  37.   '
  38.   IF arg1$="2D"
  39.     fourdmsg!=FALSE
  40.   ELSE IF arg1$="4D"
  41.     fourdmsg!=TRUE
  42.   ENDIF
  43.   '
  44. ELSE IF LEN(arg2$)=2
  45.   '
  46.   IF arg2$="2D"
  47.     fourdmsg!=FALSE
  48.   ELSE IF arg2$="4D"
  49.     fourdmsg!=TRUE
  50.   ENDIF
  51. ENDIF
  52. '
  53. IF LEN(arg2$)>2
  54.   headit_msgname$=arg2$
  55. ELSE IF LEN(arg1$)>2
  56.   headit_msgname$=arg1$
  57. ENDIF
  58. '
  59. @headit_window
  60. @headit_mask
  61. '
  62. headit_defdir$="Mail:Matrix/"
  63. '
  64. IF headit_msgname$=""
  65.   FILESELECT "Load *.MSG","Load",headit_defdir$,headit_msgname$
  66. ENDIF
  67. '
  68. IF (EXIST(headit_msgname$)) AND (RIGHT$(headit_msgname$,1)<>"/") AND (RIGHT$(headit_msgname$,1)<>":") AND (UPPER$(headit_msgname$)<>UPPER$(headit_defdir$))
  69.   headit_defdir$=headit_msgname$
  70.   @headit_load(headit_msgname$)
  71.   @headit_display
  72.   @loc(19,1)
  73.   PRINT ansi$(0)+SPACE$(70);
  74.   @loc(19,1)
  75.   PRINT ansi$(1)+"Loaded File: '"+headit_msgname$+"'";
  76.   '
  77. ENDIF
  78. '
  79. '
  80. '
  81. '
  82. '
  83. DO
  84.   '
  85.   IF MOUSEK=1
  86.     mmxx%=MOUSEX
  87.     mmyy%=MOUSEY
  88.     '
  89.     ' Check for control gadgets first
  90.     '
  91.     IF mmyy%>74 AND mmyy%<83
  92.       '
  93.       IF mmxx%>300 AND mmxx%<348
  94.         ALERT 1,"Quit - Are you sure?",1,"Yes|No",aa%
  95.         IF aa%=1
  96.           END
  97.         ENDIF
  98.       ENDIF
  99.       '
  100.       IF mmxx%>372 AND mmxx%<420
  101.         ALERT 1,"Save - Are you sure?",1,"Yes|No",aa%
  102.         IF aa%=1
  103.           '
  104.           ' Save routine here
  105.           @loc(19,1)
  106.           PRINT ansi$(0)+SPACE$(70);
  107.           @loc(19,1)
  108.           PRINT ansi$(7)+"Saving File: '"+headit_msgname$+"'";
  109.           @headit_save
  110.           @loc(19,1)
  111.           PRINT ansi$(0)+SPACE$(70);
  112.           @loc(19,1)
  113.           PRINT ansi$(1)+"Saved File: '"+headit_msgname$+"'";
  114.           '
  115.           '
  116.         ENDIF
  117.       ENDIF
  118.       '
  119.       IF mmxx%>444 AND mmxx%<492
  120.         ALERT 1,"Load - Are you sure?",1,"Yes|No",aa%
  121.         IF aa%=1
  122.           '
  123.           FILESELECT "Load *.MSG","Load",headit_defdir$,headit_msgname$
  124.           '
  125.           IF (EXIST(headit_msgname$)) AND (RIGHT$(headit_msgname$,1)<>"/") AND (RIGHT$(headit_msgname$,1)<>":") AND (UPPER$(headit_msgname$)<>UPPER$(headit_defdir$))
  126.             headit_defdir$=headit_msgname$
  127.             @headit_load(headit_msgname$)
  128.             @headit_display
  129.             @loc(19,1)
  130.             PRINT ansi$(0)+SPACE$(70);
  131.             @loc(19,1)
  132.             PRINT ansi$(1)+"Loaded File: '"+headit_msgname$+"'";
  133.             '
  134.           ENDIF
  135.         ENDIF
  136.       ENDIF
  137.       '
  138.       IF mmxx%>516 AND mmxx%<564
  139.         ALERT 1,"Re-load from last save|Are you sure?",1,"Yes|No",aa%
  140.         IF aa%=1
  141.           @headit_load(headit_msgname$)
  142.           @headit_display
  143.           @loc(19,1)
  144.           PRINT ansi$(0)+SPACE$(70);
  145.           @loc(19,1)
  146.           PRINT ansi$(1)+"Re-Loaded File: '"+headit_msgname$+"'";
  147.           '
  148.         ENDIF
  149.       ENDIF
  150.       '
  151.     ENDIF
  152.     '
  153.     '
  154.     ' Check for Attribute toggles
  155.     '
  156.     IF mmyy%>90 AND mmyy%<99
  157.       '
  158.       IF mmxx%>100 AND mmxx%<140
  159.         IF BTST(attrib_h&,0)=TRUE
  160.           attrib_h&=BCLR(attrib_h&,0)
  161.         ELSE
  162.           attrib_h&=BSET(attrib_h&,0)
  163.         ENDIF
  164.         @loc(11,13)
  165.         IF BTST(attrib_h&,0)
  166.           @headit_showon
  167.         ELSE
  168.           @headit_showoff
  169.         ENDIF
  170.         PAUSE 20
  171.       ENDIF
  172.       '
  173.       IF mmxx%>236 AND mmxx%<276
  174.         IF BTST(attrib_h&,1)=TRUE
  175.           attrib_h&=BCLR(attrib_h&,1)
  176.         ELSE
  177.           attrib_h&=BSET(attrib_h&,1)
  178.         ENDIF
  179.         @loc(11,30)
  180.         IF BTST(attrib_h&,1)
  181.           @headit_showon
  182.         ELSE
  183.           @headit_showoff
  184.         ENDIF
  185.         PAUSE 20
  186.       ENDIF
  187.       '
  188.       IF mmxx%>380 AND mmxx%<420
  189.         IF BTST(attrib_h&,2)=TRUE
  190.           attrib_h&=BCLR(attrib_h&,2)
  191.         ELSE
  192.           attrib_h&=BSET(attrib_h&,2)
  193.         ENDIF
  194.         @loc(11,48)
  195.         IF BTST(attrib_h&,2)
  196.           @headit_showon
  197.         ELSE
  198.           @headit_showoff
  199.         ENDIF
  200.         PAUSE 20
  201.       ENDIF
  202.       '
  203.       IF mmxx%>532 AND mmxx%<572
  204.         IF BTST(attrib_h&,3)=TRUE
  205.           attrib_h&=BCLR(attrib_h&,3)
  206.         ELSE
  207.           attrib_h&=BSET(attrib_h&,3)
  208.         ENDIF
  209.         @loc(11,67)
  210.         IF BTST(attrib_h&,3)
  211.           @headit_showon
  212.         ELSE
  213.           @headit_showoff
  214.         ENDIF
  215.         PAUSE 20
  216.         '
  217.       ENDIF
  218.       '
  219.     ENDIF
  220.     '
  221.     '
  222.     IF mmyy%>106 AND mmyy%<115
  223.       '
  224.       IF mmxx%>100 AND mmxx%<140
  225.         '
  226.         ' The special File-Attach bit where subject may change.
  227.         '
  228.         IF BTST(attrib_h&,4)=TRUE
  229.           attrib_h&=BCLR(attrib_h&,4)
  230.           @loc(13,13)
  231.           @headit_showoff
  232.           PAUSE 5
  233.           ALERT 1,"You may now like to|change the subject",1,"  OK  ",aa%
  234.         ELSE
  235.           attrib_h&=BSET(attrib_h&,4)
  236.           @loc(13,13)
  237.           @headit_showon
  238.           PAUSE 5
  239.           ALERT 1,"Re-Choose filename|for subject?",1,"Yes|No",aa%
  240.           '
  241.           IF aa%=1
  242.             FILESELECT "Attach filename","Okay","RAM:",headit_attach$
  243.             headit_attach$=TRIM$(headit_attach$)
  244.             ALERT 1,"Full path or|filename only?",1,"Full|Name",ab%
  245.             IF ab%=1
  246.               subj_h$=headit_attach$
  247.             ELSE
  248.               i%=RINSTR(headit_attach$,"/")
  249.               IF i%
  250.                 subj_h$=RIGHT$(headit_attach$,LEN(headit_attach$)-i%)
  251.               ELSE
  252.                 i%=RINSTR(headit_attach$,":")
  253.                 IF i%
  254.                   subj_h$=RIGHT$(headit_attach$,LEN(headit_attach$)-i%)
  255.                 ELSE
  256.                 ENDIF
  257.               ENDIF
  258.             ENDIF
  259.             @loc(3,7)
  260.             PRINT col_b$+SPACE$(67);
  261.             @loc(3,7)
  262.             PRINT col_f$+subj_h$;
  263.             '
  264.             ' End of subject change section
  265.             '
  266.           ENDIF
  267.         ENDIF
  268.         '
  269.         '
  270.         '
  271.       ENDIF
  272.       '
  273.       IF mmxx%>236 AND mmxx%<276
  274.         IF BTST(attrib_h&,5)=TRUE
  275.           attrib_h&=BCLR(attrib_h&,5)
  276.         ELSE
  277.           attrib_h&=BSET(attrib_h&,5)
  278.         ENDIF
  279.         @loc(13,30)
  280.         IF BTST(attrib_h&,5)
  281.           @headit_showon
  282.         ELSE
  283.           @headit_showoff
  284.         ENDIF
  285.         PAUSE 20
  286.       ENDIF
  287.       '
  288.       IF mmxx%>380 AND mmxx%<420
  289.         IF BTST(attrib_h&,6)=TRUE
  290.           attrib_h&=BCLR(attrib_h&,6)
  291.         ELSE
  292.           attrib_h&=BSET(attrib_h&,6)
  293.         ENDIF
  294.         @loc(13,48)
  295.         IF BTST(attrib_h&,6)
  296.           @headit_showon
  297.         ELSE
  298.           @headit_showoff
  299.         ENDIF
  300.         PAUSE 20
  301.       ENDIF
  302.       '
  303.       IF mmxx%>532 AND mmxx%<572
  304.         IF BTST(attrib_h&,7)=TRUE
  305.           attrib_h&=BCLR(attrib_h&,7)
  306.         ELSE
  307.           attrib_h&=BSET(attrib_h&,7)
  308.         ENDIF
  309.         @loc(13,67)
  310.         IF BTST(attrib_h&,7)
  311.           @headit_showon
  312.         ELSE
  313.           @headit_showoff
  314.         ENDIF
  315.         PAUSE 20
  316.       ENDIF
  317.       '
  318.     ENDIF
  319.     '
  320.     '
  321.     IF mmyy%>122 AND mmyy%<131
  322.       '
  323.       IF mmxx%>100 AND mmxx%<140
  324.         IF BTST(attrib_h&,8)=TRUE
  325.           attrib_h&=BCLR(attrib_h&,8)
  326.         ELSE
  327.           attrib_h&=BSET(attrib_h&,8)
  328.         ENDIF
  329.         @loc(15,13)
  330.         IF BTST(attrib_h&,8)
  331.           @headit_showon
  332.         ELSE
  333.           @headit_showoff
  334.         ENDIF
  335.         PAUSE 20
  336.       ENDIF
  337.       '
  338.       IF mmxx%>236 AND mmxx%<276
  339.         IF BTST(attrib_h&,9)=TRUE
  340.           attrib_h&=BCLR(attrib_h&,9)
  341.         ELSE
  342.           attrib_h&=BSET(attrib_h&,9)
  343.         ENDIF
  344.         @loc(15,30)
  345.         IF BTST(attrib_h&,9)
  346.           @headit_showon
  347.         ELSE
  348.           @headit_showoff
  349.         ENDIF
  350.         PAUSE 20
  351.       ENDIF
  352.       '
  353.       IF mmxx%>380 AND mmxx%<420
  354.         IF BTST(attrib_h&,10)=TRUE
  355.           attrib_h&=BCLR(attrib_h&,10)
  356.         ELSE
  357.           attrib_h&=BSET(attrib_h&,10)
  358.         ENDIF
  359.         @loc(15,48)
  360.         IF BTST(attrib_h&,10)
  361.           @headit_showon
  362.         ELSE
  363.           @headit_showoff
  364.         ENDIF
  365.         PAUSE 20
  366.       ENDIF
  367.       '
  368.       IF mmxx%>532 AND mmxx%<572
  369.         IF BTST(attrib_h&,11)=TRUE
  370.           attrib_h&=BCLR(attrib_h&,11)
  371.         ELSE
  372.           attrib_h&=BSET(attrib_h&,11)
  373.         ENDIF
  374.         @loc(15,67)
  375.         IF BTST(attrib_h&,11)
  376.           @headit_showon
  377.         ELSE
  378.           @headit_showoff
  379.         ENDIF
  380.         PAUSE 20
  381.       ENDIF
  382.       '
  383.     ENDIF
  384.     '
  385.     '
  386.     IF mmyy%>138 AND mmyy%<147
  387.       '
  388.       IF mmxx%>100 AND mmxx%<140
  389.         IF BTST(attrib_h&,12)=TRUE
  390.           attrib_h&=BCLR(attrib_h&,12)
  391.         ELSE
  392.           attrib_h&=BSET(attrib_h&,12)
  393.         ENDIF
  394.         @loc(17,13)
  395.         IF BTST(attrib_h&,12)
  396.           @headit_showon
  397.         ELSE
  398.           @headit_showoff
  399.         ENDIF
  400.         PAUSE 20
  401.       ENDIF
  402.       '
  403.       IF mmxx%>236 AND mmxx%<276
  404.         IF BTST(attrib_h&,13)=TRUE
  405.           attrib_h&=BCLR(attrib_h&,13)
  406.         ELSE
  407.           attrib_h&=BSET(attrib_h&,13)
  408.         ENDIF
  409.         @loc(17,30)
  410.         IF BTST(attrib_h&,13)
  411.           @headit_showon
  412.         ELSE
  413.           @headit_showoff
  414.         ENDIF
  415.         PAUSE 20
  416.       ENDIF
  417.       '
  418.       IF mmxx%>380 AND mmxx%<420
  419.         IF BTST(attrib_h&,14)=TRUE
  420.           attrib_h&=BCLR(attrib_h&,14)
  421.         ELSE
  422.           attrib_h&=BSET(attrib_h&,14)
  423.         ENDIF
  424.         @loc(17,48)
  425.         IF BTST(attrib_h&,14)
  426.           @headit_showon
  427.         ELSE
  428.           @headit_showoff
  429.         ENDIF
  430.         PAUSE 20
  431.       ENDIF
  432.       '
  433.     ENDIF
  434.     '
  435.     '
  436.     ' Check for string changes
  437.     '
  438.     col_e$=esc$+"[35;43m"
  439.     '
  440.     ' First line
  441.     '
  442.     IF mmyy%>10 AND mmyy%<19
  443.       IF mmxx%>44 AND mmxx%<292
  444.         WHILE INKEY$<>""
  445.         WEND
  446.         @loc(1,7)
  447.         PRINT col_e$;
  448.         xx$=from_h$
  449.         FORM INPUT 30 AS xx$
  450.         xx$=UPPER$(TRIM$(xx$))
  451.         @lowercase(xx$)
  452.         from_h$=lcase$
  453.         @loc(1,7)
  454.         PRINT col_b$+SPACE$(30);
  455.         @loc(1,7)
  456.         PRINT col_f$+from_h$;
  457.       ENDIF
  458.       '
  459.       IF mmxx%>340 AND mmxx%<588
  460.         WHILE INKEY$<>""
  461.         WEND
  462.         @loc(1,44)
  463.         PRINT col_e$;
  464.         xx$=to_h$
  465.         FORM INPUT 30 AS xx$
  466.         xx$=UPPER$(TRIM$(xx$))
  467.         @lowercase(xx$)
  468.         to_h$=lcase$
  469.         @loc(1,44)
  470.         PRINT col_b$+SPACE$(30);
  471.         @loc(1,44)
  472.         PRINT col_f$+to_h$;
  473.       ENDIF
  474.     ENDIF
  475.     '
  476.     ' Second line
  477.     '
  478.     IF mmyy%>26 AND mmyy%<35
  479.       WHILE INKEY$<>""
  480.       WEND
  481.       @loc(3,7)
  482.       PRINT col_e$;
  483.       xx$=subj_h$
  484.       FORM INPUT 67 AS xx$
  485.       xx$=TRIM$(xx$)
  486.       subj_h$=xx$
  487.       @loc(3,7)
  488.       PRINT col_b$+SPACE$(67);
  489.       @loc(3,7)
  490.       PRINT col_f$+subj_h$;
  491.     ENDIF
  492.     '
  493.     '
  494.     ' Third line
  495.     '
  496.     IF mmyy%>42 AND mmyy%<51
  497.       IF mmxx%>44 AND mmxx%<212
  498.         WHILE INKEY$<>""
  499.         WEND
  500.         @loc(5,7)
  501.         PRINT col_e$;
  502.         xx$=dattime_h$
  503.         FORM INPUT 19 AS xx$
  504.         xx$=TRIM$(xx$)
  505.         dattime_h$=xx$
  506.         @loc(5,7)
  507.         PRINT col_b$+SPACE$(18);
  508.         @loc(5,7)
  509.         PRINT col_f$+dattime_h$;
  510.       ENDIF
  511.       '
  512.       IF mmxx%>340 AND mmxx%<396
  513.         WHILE INKEY$<>""
  514.         WEND
  515.         @loc(5,44)
  516.         PRINT col_e$;
  517.         xx$=tiread_h$
  518.         FORM INPUT 6 AS xx$
  519.         xx$=TRIM$(xx$)
  520.         tiread_h$=xx$
  521.         @loc(5,44)
  522.         PRINT col_b$+SPACE$(6);
  523.         @loc(5,44)
  524.         PRINT col_f$+tiread_h$;
  525.       ENDIF
  526.       '
  527.       IF mmxx%>500 AND mmxx%<556
  528.         WHILE INKEY$<>""
  529.         WEND
  530.         @loc(5,64)
  531.         PRINT col_e$;
  532.         xx$=cost_h$
  533.         FORM INPUT 6 AS xx$
  534.         xx$=TRIM$(xx$)
  535.         cost_h$=xx$
  536.         @loc(5,64)
  537.         PRINT col_b$+SPACE$(6);
  538.         @loc(5,64)
  539.         PRINT col_f$+cost_h$;
  540.       ENDIF
  541.     ENDIF
  542.     '
  543.     ' Fourth line
  544.     '
  545.     IF mmyy%>58 AND mmyy%<67
  546.       IF mmxx%>44 AND mmxx%<212
  547.         WHILE INKEY$<>""
  548.         WEND
  549.         @loc(7,7)
  550.         PRINT col_e$;
  551.         xx$=orig_h$
  552.         FORM INPUT 19 AS xx$
  553.         xx$=TRIM$(xx$)
  554.         '
  555.         IF fourdmsg!
  556.           @headit_fqfa(xx$,origzone_h&,orignet_h&,orignode_h&,0)
  557.         ELSE
  558.           xx$="3:"+xx$
  559.           @headit_fqfa(xx$,3,orignet_h&,orignode_h&,0)
  560.         ENDIF
  561.         '
  562.         IF zone&+net&+node&+point&>0
  563.           IF fourdmsg!
  564.             orig_h$=STR$(zone&)+":"+STR$(net&)+"/"+STR$(node&)+"."+STR$(point&)
  565.           ELSE
  566.             orig_h$=STR$(net&)+"/"+STR$(node&)
  567.           ENDIF
  568.         ELSE
  569.           PRINT CHR$(7);
  570.         ENDIF
  571.         '
  572.         @loc(7,7)
  573.         PRINT col_b$+SPACE$(19);
  574.         @loc(7,7)
  575.         PRINT col_f$+orig_h$;
  576.       ENDIF
  577.       '
  578.       IF mmxx%>340 AND mmxx%<396
  579.         WHILE INKEY$<>""
  580.         WEND
  581.         @loc(7,44)
  582.         PRINT col_e$;
  583.         xx$=replyto_h$
  584.         FORM INPUT 6 AS xx$
  585.         xx$=TRIM$(xx$)
  586.         replyto_h$=xx$
  587.         @loc(7,44)
  588.         PRINT col_b$+SPACE$(6);
  589.         @loc(7,44)
  590.         PRINT col_f$+replyto_h$;
  591.       ENDIF
  592.       '
  593.       IF mmxx%>500 AND mmxx%<556
  594.         WHILE INKEY$<>""
  595.         WEND
  596.         @loc(7,64)
  597.         PRINT col_e$;
  598.         xx$=nextreply_h$
  599.         FORM INPUT 6 AS xx$
  600.         xx$=TRIM$(xx$)
  601.         nextreply_h$=xx$
  602.         @loc(7,64)
  603.         PRINT col_b$+SPACE$(6);
  604.         @loc(7,64)
  605.         PRINT col_f$+nextreply_h$;
  606.       ENDIF
  607.     ENDIF
  608.     '
  609.     '
  610.     ' Fifth line
  611.     '
  612.     IF mmyy%>74 AND mmyy%<83
  613.       IF mmxx%>44 AND mmxx%<212
  614.         WHILE INKEY$<>""
  615.         WEND
  616.         @loc(9,7)
  617.         PRINT col_e$;
  618.         xx$=dest_h$
  619.         FORM INPUT 19 AS xx$
  620.         xx$=TRIM$(xx$)
  621.         '
  622.         IF fourdmsg!
  623.           @headit_fqfa(xx$,destzone_h&,destnet_h&,destnode_h&,0)
  624.         ELSE
  625.           xx$="3:"+xx$
  626.           @headit_fqfa(xx$,3,destnet_h&,destnode_h&,0)
  627.         ENDIF
  628.         '
  629.         IF zone&+net&+node&+point&>0
  630.           IF fourdmsg!
  631.             dest_h$=STR$(zone&)+":"+STR$(net&)+"/"+STR$(node&)+"."+STR$(point&)
  632.           ELSE
  633.             dest_h$=STR$(net&)+"/"+STR$(node&)
  634.           ENDIF
  635.         ELSE
  636.           PRINT CHR$(7);
  637.         ENDIF
  638.         '
  639.         @loc(9,7)
  640.         PRINT col_b$+SPACE$(19);
  641.         @loc(9,7)
  642.         PRINT col_f$+dest_h$;
  643.       ENDIF
  644.     ENDIF
  645.     '
  646.     '  End of poll-loop-processing
  647.     '
  648.   ENDIF
  649. LOOP
  650. '
  651. '
  652. '
  653. '
  654. END
  655. '
  656. '
  657. PROCEDURE headit_mask
  658.   PRINT CHR$(12);
  659.   '
  660.   @loc(1,0)
  661.   PRINT ansi$(2)+"From:";
  662.   @loc(1,40)
  663.   PRINT ansi$(2)+"To:";
  664.   @loc(3,0)
  665.   PRINT ansi$(2)+"Subj:";
  666.   @loc(5,0)
  667.   PRINT ansi$(2)+"Date:";
  668.   @loc(5,32)
  669.   PRINT ansi$(2)+"Times Read:";
  670.   @loc(5,58)
  671.   PRINT ansi$(2)+"Cost:";
  672.   @loc(7,0)
  673.   PRINT ansi$(2)+"Orig:";
  674.   @loc(7,34)
  675.   PRINT ansi$(2)+"Reply To:";
  676.   @loc(7,52)
  677.   PRINT ansi$(2)+"Next Reply:";
  678.   @loc(9,0)
  679.   PRINT ansi$(2)+"Dest:";
  680.   @loc(9,38)
  681.   PRINT esc$+"[34;42m QUIT "+ansi$(0);
  682.   @loc(9,47)
  683.   PRINT esc$+"[34;42m SAVE "+ansi$(0);
  684.   @loc(9,56)
  685.   PRINT esc$+"[34;42m LOAD "+ansi$(0);
  686.   @loc(9,65)
  687.   PRINT esc$+"[34;42m RELD "+ansi$(0);
  688.   '
  689.   '
  690.   @loc(11,4)
  691.   PRINT ansi$(6)+"Private:";
  692.   @loc(11,23)
  693.   PRINT ansi$(6)+"Crash:";
  694.   @loc(11,38)
  695.   PRINT ansi$(6)+"Received:";
  696.   @loc(11,61)
  697.   PRINT ansi$(6)+"Sent:";
  698.   @loc(13,1)
  699.   PRINT ansi$(6)+"FileAttach:";
  700.   @loc(13,19)
  701.   PRINT ansi$(6)+"InTransit:";
  702.   @loc(13,40)
  703.   PRINT ansi$(6)+"Orphan:";
  704.   @loc(13,57)
  705.   PRINT ansi$(6)+"KillSent:";
  706.   @loc(15,6)
  707.   PRINT ansi$(6)+"Local:";
  708.   @loc(15,24)
  709.   PRINT ansi$(6)+"Hold:";
  710.   @loc(15,40)
  711.   PRINT ansi$(6)+"Unused:";
  712.   @loc(15,60)
  713.   PRINT ansi$(6)+"F'req:";
  714.   @loc(17,2)
  715.   PRINT ansi$(6)+"RetRecReq:";
  716.   @loc(17,20)
  717.   PRINT ansi$(6)+"IsRetRec:";
  718.   @loc(17,38)
  719.   PRINT ansi$(6)+"AuditReq:";
  720.   @loc(17,57)
  721.   PRINT ansi$(6)+"UpDF'req:";
  722.   '
  723.   ' @loc(10,1)
  724.   ' PRINT ansi$(0)+"12345678901234567890123456789012345678901234567890123456789012345678901234";
  725.   '
  726. RETURN
  727. '
  728. '
  729. PROCEDURE headit_display
  730.   '
  731.   col_b$=esc$+"[43m"
  732.   col_f$=esc$+"[34m"
  733.   '
  734.   @loc(1,6)
  735.   PRINT col_b$+SPACE$(31);
  736.   @loc(1,7)
  737.   PRINT col_f$+from_h$;
  738.   '
  739.   @loc(1,43)
  740.   PRINT col_b$+SPACE$(31);
  741.   @loc(1,44)
  742.   PRINT col_f$+to_h$;
  743.   '
  744.   @loc(3,6)
  745.   PRINT col_b$+SPACE$(68);
  746.   @loc(3,7)
  747.   PRINT col_f$+subj_h$;
  748.   '
  749.   @loc(5,6)
  750.   PRINT col_b$+SPACE$(21);
  751.   @loc(5,7)
  752.   PRINT col_f$+dattime_h$;
  753.   '
  754.   @loc(5,43)
  755.   PRINT col_b$+SPACE$(7);
  756.   @loc(5,44)
  757.   PRINT col_f$+tiread_h$;
  758.   '
  759.   @loc(5,63)
  760.   PRINT col_b$+SPACE$(7);
  761.   @loc(5,64)
  762.   PRINT col_f$+cost_h$;
  763.   '
  764.   @loc(7,6)
  765.   PRINT col_b$+SPACE$(21);
  766.   @loc(7,7)
  767.   PRINT col_f$+orig_h$;
  768.   '
  769.   @loc(7,43)
  770.   PRINT col_b$+SPACE$(7);
  771.   @loc(7,44)
  772.   PRINT col_f$+replyto_h$;
  773.   '
  774.   @loc(7,63)
  775.   PRINT col_b$+SPACE$(7);
  776.   @loc(7,64)
  777.   PRINT col_f$+nextreply_h$;
  778.   '
  779.   @loc(9,6)
  780.   PRINT col_b$+SPACE$(21);
  781.   @loc(9,7)
  782.   PRINT col_f$+dest_h$;
  783.   '
  784.   '
  785.   '
  786.   '
  787.   '
  788.   @loc(11,13)
  789.   IF BTST(attrib_h&,0)
  790.     @headit_showon
  791.   ELSE
  792.     @headit_showoff
  793.   ENDIF
  794.   '
  795.   @loc(11,30)
  796.   IF BTST(attrib_h&,1)
  797.     @headit_showon
  798.   ELSE
  799.     @headit_showoff
  800.   ENDIF
  801.   '
  802.   @loc(11,48)
  803.   IF BTST(attrib_h&,2)
  804.     @headit_showon
  805.   ELSE
  806.     @headit_showoff
  807.   ENDIF
  808.   '
  809.   @loc(11,67)
  810.   IF BTST(attrib_h&,3)
  811.     @headit_showon
  812.   ELSE
  813.     @headit_showoff
  814.   ENDIF
  815.   '
  816.   @loc(13,13)
  817.   IF BTST(attrib_h&,4)
  818.     @headit_showon
  819.   ELSE
  820.     @headit_showoff
  821.   ENDIF
  822.   '
  823.   @loc(13,30)
  824.   IF BTST(attrib_h&,5)
  825.     @headit_showon
  826.   ELSE
  827.     @headit_showoff
  828.   ENDIF
  829.   '
  830.   @loc(13,48)
  831.   IF BTST(attrib_h&,6)
  832.     @headit_showon
  833.   ELSE
  834.     @headit_showoff
  835.   ENDIF
  836.   '
  837.   @loc(13,67)
  838.   IF BTST(attrib_h&,7)
  839.     @headit_showon
  840.   ELSE
  841.     @headit_showoff
  842.   ENDIF
  843.   '
  844.   @loc(15,13)
  845.   IF BTST(attrib_h&,8)
  846.     @headit_showon
  847.   ELSE
  848.     @headit_showoff
  849.   ENDIF
  850.   '
  851.   @loc(15,30)
  852.   IF BTST(attrib_h&,9)
  853.     @headit_showon
  854.   ELSE
  855.     @headit_showoff
  856.   ENDIF
  857.   '
  858.   @loc(15,48)
  859.   IF BTST(attrib_h&,10)
  860.     @headit_showon
  861.   ELSE
  862.     @headit_showoff
  863.   ENDIF
  864.   '
  865.   @loc(15,67)
  866.   IF BTST(attrib_h&,11)
  867.     @headit_showon
  868.   ELSE
  869.     @headit_showoff
  870.   ENDIF
  871.   '
  872.   @loc(17,13)
  873.   IF BTST(attrib_h&,12)
  874.     @headit_showon
  875.   ELSE
  876.     @headit_showoff
  877.   ENDIF
  878.   '
  879.   @loc(17,30)
  880.   IF BTST(attrib_h&,13)
  881.     @headit_showon
  882.   ELSE
  883.     @headit_showoff
  884.   ENDIF
  885.   '
  886.   @loc(17,48)
  887.   IF BTST(attrib_h&,14)
  888.     @headit_showon
  889.   ELSE
  890.     @headit_showoff
  891.   ENDIF
  892.   '
  893.   @loc(17,67)
  894.   PRINT esc$+"[35;46m"+" XXX ";
  895.   '
  896. RETURN
  897. '
  898. '
  899. PROCEDURE headit_showon
  900.   PRINT esc$+"[31;47m"+" ON  ";
  901. RETURN
  902. '
  903. '
  904. PROCEDURE headit_showoff
  905.   PRINT esc$+"[35;47m"+" OFF ";
  906. RETURN
  907. '
  908. '
  909. PROCEDURE loc(cx%,cy%)
  910.   PRINT esc$+"["+STR$(cx%)+";"+STR$(cy%)+"H";
  911. RETURN
  912. '
  913. '
  914. PROCEDURE dispcoords(mx%,my%)
  915.   loc(19,58)
  916.   PRINT ansi$(0)+"X: "+STR$(mx%)+"     ";
  917.   loc(19,66)
  918.   PRINT "Y: "+STR$(my%)+"  ";
  919. RETURN
  920. '
  921. '
  922. PROCEDURE headit_window
  923.   OPENW #5,20,28,600,166,0,4102,1
  924.   xx$=" "+versname$+" - Msg HEADer edITor by Peter Deane V"+versnum$+" ("+versdate$+")"
  925.   TITLEW #5,xx$,xx$
  926. RETURN
  927. '
  928. '
  929. PROCEDURE headit_load(mess$)
  930.   '
  931.   spoth%=AllocMem(200,65536)
  932.   xx$=mess$+CHR$(0)
  933.   filehand%=Open(V:xx$,1005)
  934.   '
  935.   IF filehand%<>0
  936.     '
  937.     ~Read(filehand%,spoth%,190)
  938.     ~Close(filehand%)
  939.     POKE (spoth%+191),0
  940.     POKE (spoth%+192),0
  941.     POKE (spoth%+193),0
  942.     @getmsgdetails(spoth%)
  943.     '
  944.     from_h$=LEFT$(fromname$,31)
  945.     to_h$=LEFT$(toname$,31)
  946.     subj_h$=LEFT$(subject$,68)
  947.     IF UPPER$(LEFT$(subj_h$,3))="RE:"
  948.       subj_h$=TRIM$(MID$(subj_h$,4,72))
  949.     ENDIF
  950.     dattime_h$=dattime$
  951.     '
  952.     '
  953.     IF fourdmsg!=TRUE
  954.       dest_h$=STR$(destzone&)+":"+STR$(destnet&)+"/"+STR$(destnode&)+"."+STR$(destpoint&)
  955.     ELSE
  956.       dest_h$=STR$(destnet&)+"/"+STR$(destnode&)
  957.     ENDIF
  958.     '
  959.     IF fourdmsg!=TRUE
  960.       orig_h$=STR$(origzone&)+":"+STR$(orignet&)+"/"+STR$(orignode&)+"."+STR$(origpoint&)
  961.     ELSE
  962.       orig_h$=STR$(orignet&)+"/"+STR$(orignode&)
  963.     ENDIF
  964.     '
  965.     ' keep attribute as an integer..
  966.     '
  967.     attrib_h&=attribute&
  968.     '
  969.     tiread_h$=STR$(timesread&)
  970.     cost_h$=STR$(cost&)
  971.     replyto_h$=STR$(replyto&)
  972.     nextreply_h$=STR$(nextreply&)
  973.     '
  974.     ' Preserve node numbers as integers, too...
  975.     '
  976.     origzone_h&=origzone&
  977.     orignet_h&=orignet&
  978.     orignode_h&=orignode&
  979.     origpoint_h&=origpoint&
  980.     '
  981.     destzone_h&=destzone&
  982.     destnet_h&=destnet&
  983.     destnode_h&=destnode&
  984.     destpoint_h&=destpoint&
  985.     '
  986.   ENDIF
  987.   @headit_clear
  988.   '
  989. RETURN
  990. '
  991. '
  992. PROCEDURE headit_clear
  993.   IF spoth%
  994.     ~FreeMem(spoth%,200)
  995.     spoth%=0
  996.   ENDIF
  997. RETURN
  998. '
  999. '
  1000. PROCEDURE headit_save
  1001.   '
  1002.   ' Figure our node numbers out
  1003.   '
  1004.   @headit_fqfa(orig_h$,1,0,0,0)
  1005.   origzone_h&=zone&
  1006.   orignet_h&=net&
  1007.   orignode_h&=node&
  1008.   origpoint_h&=point&
  1009.   '
  1010.   @headit_fqfa(dest_h$,1,0,0,0)
  1011.   destzone_h&=zone&
  1012.   destnet_h&=net&
  1013.   destnode_h&=node&
  1014.   destpoint_h&=point&
  1015.   '
  1016.   '
  1017.   OPEN "U",#2,headit_msgname$,512
  1018.   '
  1019.   from_h$=from_h$+CHR$(0)
  1020.   PRINT #2,from_h$;
  1021.   @spaceout(from_h$,36)
  1022.   PRINT #2,STRING$(spc%,CHR$(0));
  1023.   '
  1024.   to_h$=to_h$+CHR$(0)
  1025.   PRINT #2,to_h$;
  1026.   @spaceout(to_h$,36)
  1027.   PRINT #2,STRING$(spc%,CHR$(0));
  1028.   '
  1029.   subj_h$=subj_h$+CHR$(0)
  1030.   PRINT #2,subj_h$;
  1031.   @spaceout(subj_h$,72)
  1032.   PRINT #2,STRING$(spc%,CHR$(0));
  1033.   '
  1034.   dattime_h$=LEFT$(dattime_h$,19)
  1035.   dattime_h$=dattime_h$+CHR$(0)
  1036.   PRINT #2,dattime_h$;
  1037.   @spaceout(dattime_h$,20)
  1038.   PRINT #2,STRING$(spc%,CHR$(0));
  1039.   '
  1040.   SEEK #2,164
  1041.   '
  1042.   ' Times Read
  1043.   PRINT #2,MKI$(VAL(tiread_h$));
  1044.   ' destnode
  1045.   PRINT #2,MKI$(destnode_h&);
  1046.   ' orignode
  1047.   PRINT #2,MKI$(orignode_h&);
  1048.   ' cost
  1049.   PRINT #2,MKI$(VAL(cost_h$));
  1050.   ' orig net
  1051.   PRINT #2,MKI$(orignet_h&);
  1052.   ' destnet
  1053.   PRINT #2,MKI$(destnet_h&);
  1054.   '
  1055.   IF fourdmsg!
  1056.     PRINT #2,MKI$(destzone_h&);
  1057.     ' origzone
  1058.     PRINT #2,MKI$(origzone_h&);
  1059.     ' destpoint
  1060.     PRINT #2,MKI$(destpoint_h&);
  1061.     ' origpoint
  1062.     PRINT #2,MKI$(origpoint_h&);
  1063.   ENDIF
  1064.   '
  1065.   ' If not 4d message - leave well alone! :-)
  1066.   '
  1067.   SEEK #2,184
  1068.   '
  1069.   ' reply to
  1070.   PRINT #2,MKI$(VAL(replyto_h$));
  1071.   ' attribute
  1072.   PRINT #2,MKI$(attrib_h&);
  1073.   ' Next reply
  1074.   PRINT #2,MKI$(VAL(nextreply_h$));
  1075.   '
  1076.   CLOSE #2
  1077.   '
  1078. RETURN
  1079. '
  1080. '
  1081. PROCEDURE headit_fqfa(headit_node$,defzone&,defnet&,defnode&,defpoint&)
  1082.   '
  1083.   convnode$=headit_node$+CHR$(0)
  1084.   addr=0
  1085.   defaddr%=0
  1086.   IF defzone&<0
  1087.     defzone&=1
  1088.   ENDIF
  1089.   '
  1090.   nodelistlib$="traplist.library"+CHR$(0)
  1091.   nodelistbase=OpenLibrary(V:nodelistlib$,0)
  1092.   '
  1093.   IF nodelistbase=0
  1094.     zone&=0
  1095.     net&=0
  1096.     node&=0
  1097.     point&=0
  1098.   ELSE
  1099.     '
  1100.     addr=AllocMem(8,65536)
  1101.     defaddr%=AllocMem(8,65536)
  1102.     '
  1103.     DPOKE defaddr%+0,defzone&
  1104.     DPOKE defaddr%+2,defnet&
  1105.     DPOKE defaddr%+4,defnode&
  1106.     DPOKE defaddr%+6,defpoint&
  1107.     '
  1108.     ' parse the input into addr% via the library.
  1109.     '
  1110.     @nlparseaddr(addr,V:convnode$,defaddr%)
  1111.     '
  1112.     IF m68%(0)=0
  1113.       zone&=DPEEK(addr+0)
  1114.       net&=DPEEK(addr+2)
  1115.       node&=DPEEK(addr+4)
  1116.       point&=DPEEK(addr+6)
  1117.     ELSE
  1118.       zone&=0
  1119.       net&=0
  1120.       node&=0
  1121.       point&=0
  1122.     ENDIF
  1123.   ENDIF
  1124.   '
  1125.   IF addr
  1126.     ~FreeMem(addr,8)
  1127.     addr=0
  1128.   ENDIF
  1129.   '
  1130.   IF defaddr%
  1131.     ~FreeMem(defaddr%,8)
  1132.     defaddr%=0
  1133.   ENDIF
  1134.   '
  1135.   IF nodelistbase
  1136.     ~CloseLibrary(nodelistbase)
  1137.     nodelistbase=0
  1138.   ENDIF
  1139.   '
  1140. RETURN
  1141. '
  1142. '
  1143. ' ======= Stuff  IN  Plutonic below  VVVVVV
  1144. '
  1145. '
  1146. '
  1147. '
  1148. '
  1149. PROCEDURE getmsgdetails(mem%)
  1150.   '
  1151.   fromname$=CHAR{mem%+0}
  1152.   toname$=CHAR{mem%+36}
  1153.   subject$=CHAR{mem%+72}
  1154.   IF UPPER$(LEFT$(subject$,3))="RE:"
  1155.     subject$=TRIM$(MID$(subject$,4,72))
  1156.   ENDIF
  1157.   dattime$=CHAR{mem%+144}
  1158.   '
  1159.   timesread&=BCLR(DPEEK(mem%+164),15)
  1160.   destnode&=BCLR(DPEEK(mem%+166),15)
  1161.   orignode&=BCLR(DPEEK(mem%+168),15)
  1162.   cost&=BCLR(DPEEK(mem%+170),15)
  1163.   orignet&=BCLR(DPEEK(mem%+172),15)
  1164.   destnet&=BCLR(DPEEK(mem%+174),15)
  1165.   destzone&=BCLR(DPEEK(mem%+176),15)
  1166.   origzone&=BCLR(DPEEK(mem%+178),15)
  1167.   destpoint&=BCLR(DPEEK(mem%+180),15)
  1168.   origpoint&=BCLR(DPEEK(mem%+182),15)
  1169.   replyto&=BCLR(DPEEK(mem%+184),15)
  1170.   attribute&=BCLR(DPEEK(mem%+186),15)
  1171.   nextreply&=BCLR(DPEEK(mem%+188),15)
  1172.   '
  1173. RETURN
  1174. '
  1175. '
  1176. PROCEDURE setansi
  1177.   '
  1178.   ansi$(1)=esc$+"[31m"
  1179.   ansi$(2)=esc$+"[32m"
  1180.   ansi$(3)=esc$+"[33m"
  1181.   ansi$(4)=esc$+"[34m"
  1182.   ansi$(5)=esc$+"[35m"
  1183.   ansi$(6)=esc$+"[36m"
  1184.   ansi$(7)=esc$+"[37m"
  1185.   ansi$(8)=esc$+"[1m"
  1186.   ansi$(9)=esc$+"[3m"
  1187.   ansi$(10)=esc$+"[4m"
  1188.   ansi$(0)=esc$+"[0;37;40m"
  1189.   '
  1190. RETURN
  1191. '
  1192. '
  1193. PROCEDURE open_screen
  1194.   OPENS 1,0,0,640,200,3,32768
  1195.   SETCOLOR 0,&H0
  1196.   SETCOLOR 1,&HD22
  1197.   SETCOLOR 2,&H1D1
  1198.   SETCOLOR 3,&HDD1
  1199.   SETCOLOR 4,&H55D
  1200.   SETCOLOR 5,&HD1E
  1201.   SETCOLOR 6,&H1DE
  1202.   SETCOLOR 7,&HFFF
  1203.   xx$=" "+versname$+" - Msg HEADer edITor by Peter Deane V"+versnum$+" ("+versdate$+")"
  1204.   TITLES #1,xx$
  1205. RETURN
  1206. '
  1207. '
  1208. PROCEDURE lowercase(ucase$)
  1209.   '
  1210.   LOCAL ad,ad2
  1211.   ad=0
  1212.   ad2=0
  1213.   '
  1214.   lcase$=ucase$
  1215.   IF LEN(ucase$)<1 OR LEN(ucase$)>56
  1216.     GOTO noworkjump
  1217.   ENDIF
  1218.   '
  1219.   ad=AllocMem(60,65536)
  1220.   IF ad=0
  1221.     GOTO noworkjump
  1222.   ENDIF
  1223.   ad2=AllocMem(60,65536)
  1224.   IF ad2=0
  1225.     GOTO noworkjump
  1226.   ENDIF
  1227.   '
  1228.   FOR k%=0 TO 59
  1229.     POKE ad+k%,0
  1230.     POKE ad2+k%,0
  1231.   NEXT k%
  1232.   '
  1233.   FOR k%=1 TO LEN(ucase$)
  1234.     POKE ad+(k%-1),ASC(MID$(ucase$,k%,1))
  1235.     POKE ad2+(k%-1),ASC(MID$(ucase$,k%,1))
  1236.   NEXT k%
  1237.   '
  1238.   FOR k%=1 TO 60
  1239.     ' start at second char. Leave first one alone!
  1240.     temp|=PEEK(ad+k%)
  1241.     IF temp|>64 AND temp|<91
  1242.       IF PEEK(ad+k%-1)>64 AND PEEK(ad+k%-1)<91
  1243.         temp|=BSET(temp|,5)
  1244.         POKE ad2+k%,temp|
  1245.       ENDIF
  1246.     ENDIF
  1247.   NEXT k%
  1248.   '
  1249.   lcase$=CHAR{ad2}
  1250.   lcase$=TRIM$(lcase$)
  1251.   '
  1252.   noworkjump:
  1253.   IF ad>0
  1254.     ~FreeMem(ad,60)
  1255.   ENDIF
  1256.   IF ad2>0
  1257.     ~FreeMem(ad2,60)
  1258.   ENDIF
  1259.   '
  1260. RETURN
  1261. '
  1262. '
  1263. PROCEDURE spaceout(thing$,col%)
  1264.   '
  1265.   LOCAL xx%,xq%
  1266.   '
  1267.   ' [Needs the string to format, and the column width it's going to]
  1268.   ' [Returns spc% - the number of spaces required - 1 if field overflow]
  1269.   '
  1270.   xx%=FRE(1)
  1271.   xx%=col%
  1272.   xq%=LEN(thing$)
  1273.   '
  1274.   IF xq%>xx%
  1275.     result=1
  1276.   ELSE
  1277.     result=(xx%-xq%)
  1278.   ENDIF
  1279.   '
  1280.   spc%=result
  1281.   '
  1282. RETURN
  1283. '
  1284. '
  1285. PROCEDURE nlparseaddr(addr,str%,default%)
  1286.   m68%(8)=addr
  1287.   m68%(9)=str%
  1288.   m68%(10)=default%
  1289.   m68%(14)=nodelistbase
  1290.   RCALL nodelistbase-156,m68%()
  1291. RETURN
  1292. '
  1293.